package com.open.rbac.model.entity.id;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLRestriction;

import com.open.center.jpa.model.entity.IdEntity;


@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@DynamicUpdate
@SQLRestriction("is_deleted = false")
@SQLDelete(sql = "UPDATE identity_rel SET is_deleted = 1 WHERE id = ?")
@Entity(name = "identity_rel")
public class IdentityRel extends IdEntity {

    @Column(name = "identity_id", length = 36)
    private String identityId;

    @Column(name = "rel_identity_id", length = 36)
    private String relIdentityId;

    @Column(name = "name", length = 128)
    private String name;

    @Column(name = "remark")
    private String remark;

}
